package de.bht.fb6.cg1.exercise3;

/**
 * a ring with the basic calculation operations and elements
 *
 * @param <T> needs a number class generic
 */
public interface Ring<T extends Number> {

	/**
	 * add n to the current value
	 * 
	 * @param n value to add
	 * @return result of the operation
	 */
	public Ring<T> add(Ring<T> n);

	/**
	 * subtract n from the current value.
	 * 
	 * @param n value to subtract
	 * @return result of the operation
	 */
	public Ring<T> sub(Ring<T> n);

	/**
	 * multiply the current value n times.
	 * @param n multiplier
	 * @return result of the operation
	 */
	public Ring<T> times(Ring<T> n);

	/**
	 * returns the zero element
	 * @return zero element of T
	 */
	public Ring<T> zero();

	/**
	 * get the neutral emement
	 * @return neutral one element
	 */
	public Ring<T> one();

	/**
	 * get the internal value
	 * @return internal value
	 */
	public T get();

	/**
	 * set the internal value
	 * @param n value to set
	 */
	public void set(T n);

	/**
	 * convert to string
	 * @return representation of the value
	 */
	public String toString();
}
